//
//  Model.m
//  Test
//
//  Created by student on 15-6-26.
//  Copyright (c) 2015年 cwh. All rights reserved.
//

#import "Model.h"

@implementation Model

-(instancetype)initWithDict:(NSDictionary *)dict{
    if (self=[super init]) {

        [self setValuesForKeysWithDictionary:dict];
    }
    return self;
}

+(instancetype)foodWithDict:(NSDictionary *)dict{
    return [[self alloc]initWithDict:dict];
    
}

+(NSMutableArray *)foodList{
    NSMutableArray *arrM=[[NSMutableArray alloc]init];
    NSString *path=[[NSBundle mainBundle]pathForResource:@"Food List" ofType:@"plist"];
    NSArray *arrTmp=[NSArray arrayWithContentsOfFile:path];
    for (NSDictionary *dict in arrTmp) {
        Model *model=[Model foodWithDict:dict];

        [arrM addObject:model];
    }
    return arrM;
}

@end
